{extend name="../../admin/view/main"}

{block name="button"}
<!--{if auth("add") and $page.total <= 9}-->
<button class='layui-btn layui-btn-sm layui-btn-primary' data-modal="{:url('add')}">添加用户等级</button>
<!--{/if}-->

<!--{if auth("sync")}-->
<button class='layui-btn layui-btn-sm layui-btn-primary' data-queue="{:url('sync')}">刷新用户数据</button>
<!--{/if}-->
{/block}

{block name='content'}
<div class="think-box-notify">
    特别注意：用户等级配置不能随意修改或删除，会影响系统结算与用户升级！
</div>

<div class="think-box-shadow margin-top-10">
    <table class="layui-table" lay-skin="line">
        {notempty name='list'}
        <thead>
        <tr>
            <th class='list-table-check-td think-checkbox'>
                <label><input data-auto-none data-check-target='.list-check-box' type='checkbox'></label>
            </th>
            <th class="text-left nowrap">用户等级</th>
            <th class="text-center nowrap">团队计数</th>
            <th class="text-center nowrap">升级规则</th>
            <th class="text-center nowrap">入会礼包</th>
            <th class="text-center nowrap">团队总数</th>
            <th class="text-center nowrap">直属团队</th>
            <th class="text-center nowrap">间接团队</th>
            <th class="text-center nowrap">订单金额</th>
            <th class="text-left nowrap">奖利规则</th>
            <th class="text-left nowrap">使用状态</th>
            <th></th>
        </tr>
        </thead>
        {/notempty}
        <tbody>
        {foreach $list as $key=>$vo}
        <tr>
            <td class='list-table-check-td think-checkbox'>
                <label><input class="list-check-box" type='checkbox' value='{$vo.id}'></label>
            </td>
            <td class="text-left nowrap"> [ <span class="color-blue">VIP{$vo.number}</span> ] {$vo.name|default=''}</td>
            <td class="text-center nowrap">{if $vo.upgrade_team>0}<b class="layui-icon layui-icon-ok-circle color-green"></b> {else} - {/if}</td>
            <td class="text-center nowrap">{if $vo.upgrade_type eq 1}<span class="color-green">全部完成</span>{else}<span class="color-blue">任何条件</span>{/if}</td>
            <td class="text-center nowrap">{if $vo.goods_vip_status>0}<b class="layui-icon layui-icon-ok-circle color-green"></b> {else} - {/if}</td>
            <td class="text-center nowrap">{if $vo.teams_users_status>0} <b class="color-green">{$vo.teams_users_number}</b> 人 {else} - {/if}</td>
            <td class="text-center nowrap">{if $vo.teams_direct_status>0} <b class="color-green">{$vo.teams_direct_number}</b> 人 {else} - {/if}</td>
            <td class="text-center nowrap">{if $vo.teams_indirect_status>0} <b class="color-green">{$vo.teams_indirect_number}</b> 人 {else} - {/if}</td>
            <td class="text-center nowrap">{if $vo.order_amount_status>0} <b class="color-green">{$vo.order_amount_number+0}</b> 元 {else} - {/if}</td>
            <td class="text-left">{foreach $vo.rebate_rule as $v}<span class="nowrap margin-right-5">{$v}</span>{/foreach}</td>
            <td class='text-left nowrap'>{if $vo.status eq 0}<span class="color-red">已禁用</span>{elseif $vo.status eq 1}<span class="color-green">使用中</span>{/if}</td>
            <td class='text-left nowrap'>
                <!--{if auth("edit")}-->
                <a class="layui-btn layui-btn-sm" data-modal='{:url("edit")}?id={$vo.id}' data-title="编辑用户等级">编 辑</a>
                <!--{/if}-->

                <!--{if auth("state") and $vo.status eq 1}-->
                <a class="layui-btn layui-btn-sm layui-btn-warm" data-action="{:url('state')}" data-value="id#{$vo.id};status#0">禁 用</a>
                <!--{elseif auth("state") and $vo.status eq 0}-->
                <a class="layui-btn layui-btn-sm layui-btn-warm" data-action="{:url('state')}" data-value="id#{$vo.id};status#1">启 用</a>
                <!--{/if}-->

                <!--{if auth("remove")}-->
                <a class="layui-btn layui-btn-sm layui-btn-danger" data-action="{:url('remove')}" data-confirm="确定要删除用户等级吗？" data-csrf="{:systoken('remove')}" data-value="id#{$vo.id}">删 除</a>
                <!--{/if}-->
            </td>
        </tr>
        {/foreach}
        </tbody>
    </table>
    {empty name='list'}<span class="notdata">没有记录哦</span>{else}{$pagehtml|raw|default=''}{/empty}
</div>
{/block}